<%--
  Created by IntelliJ IDEA.
  User: fu sir
  Date: 2024/11/3
  Time: 12:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>学生信息列表</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <style>
        /* 可以在这里添加一些自定义样式 */
    </style>
</head>
<body>
<form class="layui-form" method="post" action="/student/list/1">
    <div class="layui-form-item">
        <div class="layui-input-inline layui-input-wrap">
            <input type="text" name="name" value="${student.studentName}" placeholder="请输入学生姓名" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
        </div>
        <div class="layui-input-inline layui-input-wrap">
            <input type="text" name="gender" value="${student.gender}" placeholder="请输入性别" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
        </div>
        <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">查询</button>
        <a class="layui-btn" href="/student/toadd">新增学生</a>
    </div>
</form>
<table class="layui-table" lay-even>
    <colgroup>
        <col width="150">
        <col width="150">
        <col width="150">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>编号</th>
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>班级编号</th>
        <th>宿舍编号</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${students}" var="u">
        <tr>
            <td>${u.sId}</td>
            <td>${u.studentNum}</td>
            <td>${u.studentName}</td>
            <td>${u.gender}</td>
            <td>${u.age}</td>
            <td>${u.classId}</td>
            <td>${u.hostelId}</td>
            <td>
                <a href="/student/toupdate/${u.sId}">修改</a>
                <a href="/student/delete/${u.sId}">删除</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="7">
            <a href="/student/list/1">首页</a>
            <c:if test="${page.currentPage != 1}">
                <a href="/student/list/${page.currentPage-1}">上一页</a>
            </c:if>
            第${page.currentPage}页/共${page.totalPage}页
            <c:if test="${page.currentPage != page.totalPage}">
                <a href="/student/list/${page.currentPage+1}">下一页</a>
            </c:if>
            <a href="/student/list/${page.totalPage}">末页</a>
        </td>
    </tr>
    </tbody>
</table>
</body>
</html>
